//
//  StoreDispatchView.m
//  shanHaiHuiApp
//
//  Created by DS on 2018/3/20.
//  Copyright © 2018年 徐双. All rights reserved.
//

#import "StoreDispatchView.h"
@interface StoreDispatchView()


@end

@implementation StoreDispatchView

- (instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        
        _disPatchLabel = [[UILabel alloc] init];
        _disPatchLabel.text = @"配送类型: 门店配送";
        _disPatchLabel.font = DEF_FontSize_12;
        _disPatchLabel.textColor = getColor(@"323232");
        
        _lineView1 = [[UIView alloc] init];
        _lineView1.backgroundColor = getColor(dividerColor);
        
        _storeLabel = [[UILabel alloc] init];
        _storeLabel.text = @"配送门店: 和平区哈尔滨";
        _storeLabel.font = DEF_FontSize_12;
        _storeLabel.textColor = getColor(@"323232");
        
        _lineView2 = [[UIView alloc] init];
        _lineView2.backgroundColor = getColor(dividerColor);
        
        _remarkLabel = [[UILabel alloc] init];
        _remarkLabel.text = @"配送备注:家里人不方便,请送上楼";
        _remarkLabel.font = DEF_FontSize_12;
        _remarkLabel.textColor = getColor(@"323232");
        _remarkLabel.numberOfLines = 0;
        
        _lineView3 = [[UIView alloc] init];
        _lineView3.backgroundColor = getColor(dividerColor);
        
        _dispatchNameLabel = [[UILabel alloc] init];
        _dispatchNameLabel.font = DEF_FontSize_12;
        _dispatchNameLabel.text = @"配送人员: 王晓伟";
        _dispatchNameLabel.textColor = getColor(@"323232");
        
        _timeLabel = [[UILabel alloc] init];
        _timeLabel.font = DEF_FontSize_12;
        _timeLabel.text = @"配送时间: 2019.1.1";
        _timeLabel.textColor = getColor(@"323232");
        
        _lineView4 = [[UIView alloc] init];
        _lineView4.backgroundColor = getColor(dividerColor);
        
        [self sd_addSubviews:@[self.disPatchLabel,self.lineView1,self.storeLabel,self.lineView2,self.remarkLabel,self.lineView3,self.dispatchNameLabel,self.timeLabel,self.lineView4]];
        
        [self layOutFrame];
        
    }
    return self;
}

- (void)layOutFrame{
    
    ws(self)
    
    [self.disPatchLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(UNIT_WIDTH(15));
        make.top.mas_equalTo(UNIT_HEIGHT(10));
        make.height.mas_equalTo(UNIT_HEIGHT(30));
    }];
    
    [self.lineView1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(weakself.disPatchLabel.mas_bottom).offset(UNIT_HEIGHT(10));
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.height.mas_equalTo(0.5);
    }];
    
    [self.storeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(weakself.lineView1.mas_bottom).offset(UNIT_HEIGHT(10));
        make.left.mas_equalTo(UNIT_WIDTH(15));
        make.height.mas_equalTo(UNIT_HEIGHT(30));
    }];
    
    [self.lineView2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(weakself.storeLabel.mas_bottom).offset(UNIT_HEIGHT(10));
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.height.mas_equalTo(0.5);
    }];
    
    [self.remarkLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(weakself.lineView2.mas_bottom).offset(UNIT_HEIGHT(10));
        make.left.mas_equalTo(UNIT_WIDTH(15));
        make.height.mas_equalTo(UNIT_HEIGHT(30));
    }];
    
    [self.lineView3 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(weakself.remarkLabel.mas_bottom).offset(UNIT_HEIGHT(10));
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.height.mas_equalTo(0.5);
    }];
    
    [self.dispatchNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(weakself.lineView3.mas_bottom).offset(UNIT_HEIGHT(10));
        make.left.mas_equalTo(UNIT_WIDTH(15));
        make.height.mas_equalTo(UNIT_HEIGHT(30));
    }];
    
    [self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(weakself.lineView3.mas_bottom).offset(UNIT_HEIGHT(10));
        make.right.mas_equalTo(UNIT_WIDTH(-15));
        make.height.mas_equalTo(UNIT_HEIGHT(30));
    }];
    
    [self.lineView4 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(weakself.dispatchNameLabel.mas_bottom).offset(UNIT_HEIGHT(10));
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.height.mas_equalTo(5);
    }];
    
}

@end
